/**
 * 
 */
package com.mbengue.corp.apr.ra.core;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * @author MMB11447
 *
 */
@Entity
@Table(name = "adresse", schema = "apr_ra")
public class Adresse implements Serializable {
  private static final long serialVersionUID = 1L;
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(insertable = true, updatable = true)
  private long id;
  @Column(nullable = true, length = 128)
  private String adresse;
  @Column(nullable = true, length = 5)
  private String codePostal;
  @Column(nullable = true, length = 128)
  private String ville;
  @Column(nullable = true, length = 64)
  private String pays;

  /**
   * @return the id
   */
  public long getId() {
    return id;
  }

  /**
   * @param id the id to set
   */
  public void setId(long id) {
    this.id = id;
  }

  /**
   * @return the adresse
   */
  public String getAdresse() {
    return adresse;
  }

  /**
   * @param adresse the adresse to set
   */
  public void setAdresse(String adresse) {
    this.adresse = adresse;
  }

  /**
   * @return the codePostal
   */
  public String getCodePostal() {
    return codePostal;
  }

  /**
   * @param codePostal the codePostal to set
   */
  public void setCodePostal(String codePostal) {
    this.codePostal = codePostal;
  }

  /**
   * @return the ville
   */
  public String getVille() {
    return ville;
  }

  /**
   * @param ville the ville to set
   */
  public void setVille(String ville) {
    this.ville = ville;
  }

  /**
   * @return the pays
   */
  public String getPays() {
    return pays;
  }

  /**
   * @param pays the pays to set
   */
  public void setPays(String pays) {
    this.pays = pays;
  }

  public String getPrint() {
    return this.toString();
  }

  public Adresse(long id, String adresse, String codePostal, String ville, String pays) {
    super();
    this.id = id;
    this.adresse = adresse;
    this.codePostal = codePostal;
    this.ville = ville;
    this.pays = pays;
  }

  public Adresse() {
  }

  @Override
  public String toString() {
    StringBuilder builder = new StringBuilder();
    builder.append(adresse != null ? adresse : "");
    builder.append(" ");
    builder.append(codePostal != null ? codePostal : "");
    builder.append(" ");
    builder.append(ville != null ? ville : "");
    builder.append(" ");
    builder.append(pays != null ? pays : "");
    return builder.toString();
  }
}
